package com.tan.androidtest.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.util.Log;

import com.tan.androidtest.IMyAidlInterface;

/**
 * 服务端测试AIDL的服务
 */

public class TestAIDLService extends Service {

    public TestAIDLService() {

    }

    IMyAidlInterface.Stub stub = new IMyAidlInterface.Stub() {
        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {

        }

        @Override
        public String getMessage() throws RemoteException {
            return "哈哈哈,我是服务端Service,我被调用了";
        }
    };

    @Override
    public void onCreate() {
        super.onCreate();
        Log.i("==--", "服务端的Service启动了");
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return stub;
    }
}
